package com.cn.ant.modules.school.entity;

import com.cn.ant.common.utils.StringUtils;
import org.hibernate.validator.constraints.Length;

import com.cn.ant.common.persistence.MyDataEntity;

/**
 * 学校专业表Entity
 * @author AntDream
 * @version 2015-08-26
 */
public class SchoolMajor extends MyDataEntity<SchoolMajor> {
	
	private static final long serialVersionUID = 1L;
	private String schoolCode;		// 学校国标
	private String schoolCodeSn;		// 学校国标
	private String schoolName;		// 学校名称
	private String majorCode;		// 专业编码
	private String majorName;		// 专业名称
	private String isKeyPoint;		// 是否重点专业
	private String isCharacteristic;		// 是否特色专业
	private String sort;		// 专业排序
	
	public SchoolMajor() {
		super();
	}

	public SchoolMajor(String id){
		super(id);
	}

	@Length(min=0, max=32, message="学校国标长度必须介于 0 和 32 之间")
	public String getSchoolCode() {
		return schoolCode;
	}

	public void setSchoolCode(String schoolCode) {
		this.schoolCode = schoolCode;
	}

	public String getSchoolCodeSn() {
		return schoolCodeSn;
	}

	public void setSchoolCodeSn(String schoolCodeSn) {
		this.schoolCodeSn = schoolCodeSn;
	}

	@Length(min=0, max=64, message="学校名称长度必须介于 0 和 64 之间")
	public String getSchoolName() {
		return schoolName;
	}

	public void setSchoolName(String schoolName) {
		this.schoolName = schoolName;
	}
	
	@Length(min=0, max=32, message="专业编码长度必须介于 0 和 32 之间")
	public String getMajorCode() {
		return majorCode;
	}

	public void setMajorCode(String majorCode) {
		this.majorCode = majorCode;
	}
	
	@Length(min=0, max=32, message="专业名称长度必须介于 0 和 32 之间")
	public String getMajorName() {
		return majorName;
	}

	public void setMajorName(String majorName) {
		this.majorName = majorName;
	}
	
	@Length(min=0, max=4, message="是否重点专业长度必须介于 0 和 4 之间")
	public String getIsKeyPoint() {
		return StringUtils.isNotBlank(isKeyPoint) ? isKeyPoint : "0";
	}

	public void setIsKeyPoint(String isKeyPoint) {
		if (StringUtils.isBlank(isKeyPoint)) {
			this.isKeyPoint = "0";
		} else {
			this.isKeyPoint = isKeyPoint;
		}
	}
	
	@Length(min=0, max=4, message="是否特色专业长度必须介于 0 和 4 之间")
	public String getIsCharacteristic() {
		return StringUtils.isNotBlank(isCharacteristic) ? isCharacteristic : "0";
	}

	public void setIsCharacteristic(String isCharacteristic) {
		if (StringUtils.isBlank(isCharacteristic)) {
			this.isCharacteristic = "0";
		} else {
			this.isCharacteristic = isCharacteristic;
		}
	}
	
	@Length(min=0, max=11, message="专业排序长度必须介于 0 和 11 之间")
	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}
	
}